package com.example.homework1.comtroller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RestController
public class LoginController {

    @GetMapping("/random")
    public int random() {
        return (int) ((Math.random()) * 1000);
    }


    @GetMapping("/square/{num}")
    public int square(@PathVariable int num) {
        return (int) Math.pow(num, 2);
    }
}
